#ifndef __G_FRUSTUM_H__
#define __G_FRUSTUM_H__

#include "GPlane.h"
#include "GVector3.h"
#include "GBoxOriented.h"
#include "GUtilities/GTypes.h"

namespace GMath
{
	typedef GBoxPlane	GFrustumPlane;
	typedef GBoxCorner	GFrustumCorner;

	class GFrustum
	{
	private:
		GVector3		Right;
		GVector3		Up;
		GVector3		Front;

	public:
		float			AspectRatio;
		float			FieldOfView;	// Vertical
		float			NearZ;
		float			FarZ;
		
		GVector3		Position;

						GFrustum();
						GFrustum(float TheAspectRatio, float TheFieldOfView, float TheNearZ, float TheFarZ, const GVector3& ThePosition, const GQuaternion& Orientation);
						GFrustum(float TheAspectRatio, float TheFieldOfView, float TheNearZ, float TheFarZ, const GVector3& ThePosition, const GVector3& TheRight, const GVector3& TheUp, const GVector3& TheFront);
						~GFrustum();

		void			Create(float TheAspectRatio, float TheFieldOfView, float TheNearZ, float TheFarZ, const GVector3& ThePosition, const GQuaternion& Orientation);
		void			Create(float TheAspectRatio, float TheFieldOfView, float TheNearZ, float TheFarZ, const GVector3& ThePosition, const GVector3& TheRight, const GVector3& TheUp, const GVector3& TheFront);

		const GVector3&	GetRight() const;
		const GVector3&	GetUp() const;
		const GVector3&	GetFront() const;

		void			GetPlanes(GPlane PlaneArray[G_BP_COUNT]) const;
		void			GetCorners(GVector3 CornerArray[G_BC_COUNT]) const;

		float			GetArea() const;
		float			GetVolume() const;
	};

}

#endif